﻿<%@ Page Language="C#" MasterPageFile="~/ExampleMaster.Master" AutoEventWireup="true"
    CodeBehind="SelectFilterDrill.aspx.cs" Inherits="Web.Samples.SelectFilterDrill"
    Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleZone" runat="server">
    Using a Select with Filter to perform a drill down
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="IntroTextZone" runat="server">
    Because each entry in the sequence is an object and generated classes have collections
    associated with related data, we can access this data as we would normally. LINQ
    does not change the way we work with data, it just makes it easier and more intuitive.
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="QueryExpressZone" runat="server">
    <pre class="code">            <span style="color: rgb(0,0,255)">var</span> query = <span
        style="color: rgb(0,0,255)">from</span> p <span style="color: rgb(0,0,255)">in</span> <span
            style="color: rgb(43,145,175)">Product</span>.GetProducts()
                        <span style="color: rgb(0,0,255)">where</span> p.Color == <span style="color: rgb(163,21,21)">"Black"</span> &amp;&amp; p.ProductDocuments.Count &gt; 0
                        <span style="color: rgb(0,0,255)">select</span> p;

            <span style="color: rgb(0,0,255)">foreach</span> (<span style="color: rgb(43,145,175)">Product</span> p <span
                style="color: rgb(0,0,255)">in</span> query)
            {
                <span style="color: rgb(0,0,255)">this</span>.litImperativeResults.Text += <span
                    style="color: rgb(163,21,21)">"&lt;strong&gt;"</span> + p.Name + <span style="color: rgb(163,21,21)">"&lt;/strong&gt;&lt;br
                        /&gt;\n"</span>;
                <span style="color: rgb(0,0,255)">this</span>.litImperativeResults.Text += <span
                    style="color: rgb(0,0,255)">string</span>.Format(<span style="color: rgb(163,21,21)">"&lt;div
                        style=\"padding-left: 10px;\"&gt;"</span>);
                <span style="color: rgb(0,0,255)">foreach</span> (<span style="color: rgb(0,0,255)">var</span> ob <span
                    style="color: rgb(0,0,255)">in</span> p.ProductDocuments)
                {
                    <span style="color: rgb(0,0,255)">this</span>.litImperativeResults.Text += <span
                        style="color: rgb(163,21,21)">"Document ID: "</span> + ob.DocumentID + <span style="color: rgb(163,21,21)">"&lt;br
                            /&gt;\n"</span>;
                }
                <span style="color: rgb(0,0,255)">this</span>.litImperativeResults.Text += <span
                    style="color: rgb(163,21,21)">"&lt;/div&gt;"</span>;
            }</pre>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="QueryResultsZone" runat="server">
    <asp:Literal ID="litQueryResults" runat="server" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ImperativeZone" runat="server">
    <pre class="code">            <span style="color: rgb(0,0,255)">var</span> query = <span
        style="color: rgb(43,145,175)">Product</span>.GetProducts().Where(p =&gt; p.Color == <span
            style="color: rgb(163,21,21)">"Black"</span> &amp;&amp; p.ProductDocuments.Count &gt; 0);

            <span style="color: rgb(0,0,255)">foreach</span> (<span style="color: rgb(43,145,175)">Product</span> p <span
                style="color: rgb(0,0,255)">in</span> query)
            {
                <span style="color: rgb(0,0,255)">this</span>.litImperativeResults.Text += <span
                    style="color: rgb(163,21,21)">"&lt;strong&gt;"</span> + p.Name + <span style="color: rgb(163,21,21)">"&lt;/strong&gt;&lt;br
                        /&gt;\n"</span>;
                <span style="color: rgb(0,0,255)">this</span>.litImperativeResults.Text += <span
                    style="color: rgb(0,0,255)">string</span>.Format(<span style="color: rgb(163,21,21)">"&lt;div
                        style=\"padding-left: 10px;\"&gt;"</span>);
                <span style="color: rgb(0,0,255)">foreach</span> (<span style="color: rgb(0,0,255)">var</span> ob <span
                    style="color: rgb(0,0,255)">in</span> p.ProductDocuments)
                {
                    <span style="color: rgb(0,0,255)">this</span>.litImperativeResults.Text += <span
                        style="color: rgb(163,21,21)">"Document ID: "</span> + ob.DocumentID + <span style="color: rgb(163,21,21)">"&lt;br
                            /&gt;\n"</span>;
                }
                <span style="color: rgb(0,0,255)">this</span>.litImperativeResults.Text += <span
                    style="color: rgb(163,21,21)">"&lt;/div&gt;"</span>;
            }</pre>
    <
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="ImperativeResultsZone" runat="server">
    <asp:Literal ID="litImperativeResults" runat="server" />
</asp:Content>
